package Java练习.面向对象综合练习.接口与抽象类综合练习;

public abstract class Person {
    //定义姓名和年龄
    private String name;
    private int age;

    //构造空参

    public Person() {
    }
    //构造有参方法

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //定义get和set方法

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
